<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的商城</title>
    <style>
        * {
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f5f5f5;
            color: #333;
        }

        /* 顶部导航栏样式 */
        .top-navbar {
            background-color: #eaeaea;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 50px;
            border-bottom: 1px solid #d5d5d5;
        }

        .top-navbar a {
            color: #666;
            text-decoration: none;
            margin: 0 10px;
            transition: color 0.3s ease;
        }

        .top-navbar a:hover {
            color: #1abc9c;
        }

        /* 主导航栏样式 */
        .main-navbar {
            background-color: #fff;
            display: flex;
            justify-content: space-around;
            align-items: center;
            padding: 20px 50px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .logo img {
            height: 50px;
        }

        .main-navbar .search-box {
            display: flex;
            align-items: center;
        }

        .main-navbar .search-box input {
            padding: 12px;
            width: 400px;
            border: 2px solid #1abc9c;
            border-radius: 4px 0 0 4px;
        }

        .main-navbar .search-box button {
            padding: 12px 20px;
            background-color: #1abc9c;
            border: none;
            border-radius: 0 4px 4px 0;
            color: white;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        .main-navbar .search-box button:hover {
            background-color: #16a085;
        }

        .main-navbar .cart a {
            color: #333;
            text-decoration: none;
            font-size: 1em;
            display: flex;
            align-items: center;
        }

        .main-navbar .cart i {
            margin-right: 5px;
            font-size: 1.2em;
        }

        /* 头部样式 */
        .header {
            padding: 80px 20px;
            text-align: center;
            background: linear-gradient(45deg, #1abc9c, #16a085);
            color: white;
            position: relative;
            overflow: hidden;
        }

        .header h1 {
            font-size: 3.5em;
            margin-bottom: 20px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
        }

        .header p {
            font-size: 1.2em;
            margin-bottom: 40px;
        }

        /* 轮播图样式 */
        .carousel {
            position: relative;
            width: 80%; 
            max-width: 800px; 
            margin: 0 auto;
            overflow: hidden;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
        }

        .carousel-inner {
            display: flex;
            transition: transform 0.5s ease-in-out;
        }

        .carousel-item {
            min-width: 100%;
            box-sizing: border-box;
        }

        .carousel-item img {
            width: 100%;
            height: auto;
            display: block;
            object-fit: cover;
        }

        .carousel-control {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            border: none;
            padding: 15px;
            cursor: pointer;
            font-size: 24px;
            border-radius: 50%;
            transition: background-color 0.3s ease;
        }

        .carousel-control.prev {
            left: 20px;
        }

        .carousel-control.next {
            right: 20px;
        }

        .carousel-control:hover {
            background-color: rgba(0, 0, 0, 0.8);
        }

        /* 指示器样式 */
        .carousel-indicators {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            justify-content: center;
        }

        .carousel-indicators span {
            width: 10px;
            height: 10px;
            background-color: rgba(255, 255, 255, 0.5);
            border-radius: 50%;
            margin: 0 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        .carousel-indicators span.active {
            background-color: white;
        }

        /* 内容样式 */
        .content {
            padding: 40px 20px;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            background-color: #fff;
            margin: 20px;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
        }

        .product {
            background: white;
            margin: 20px;
            padding: 20px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
            border-radius: 10px;
            text-align: center;
            transition: transform 0.3s ease;
            width: 300px;
        }

        .product:hover {
            transform: scale(1.05);
        }

        .product h3 {
            font-size: 1.5em;
            margin-bottom: 10px;
        }

        .product img {
            width: 100%;
            height: auto;
            max-height: 200px;
            object-fit: contain;
            margin-bottom: 20px;
            border-radius: 5px;
        }

        .product a {
            color: #1abc9c;
            text-decoration: none;
            font-weight: bold;
            transition: color 0.3s ease;
        }

        .product a:hover {
            color: #16a085;
        }

        .product p {
            font-size: 1.2em;
            color: #e74c3c;
            font-weight: bold;
            margin-top: 10px;
        }

        /* 页脚样式 */
        .footer {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 20px;
            width: 100%;
        }

        .footer a {
            color: #1abc9c;
            text-decoration: none;
            transition: color 0.3s ease;
        }

        .footer a:hover {
            color: #16a085;
        }

        /* 聊天框样式 */
        iframe {
            width: 100%;
            height: 500px;
            border: none;
            margin-top: 40px;
        }

        /* 回到顶部按钮样式 */
        .back-to-top {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background-color: #1abc9c;
            color: white;
            padding: 10px 15px;
            border-radius: 5px;
            text-decoration: none;
            transition: background-color 0.3s ease;
        }

        .back-to-top:hover {
            background-color: #16a085;
        }

        /* 广告区样式 */
        .ads {
            display: flex;
            justify-content: center;
            gap: 20px;
            padding: 40px 20px;
            background-color: #fff;
            margin: 20px;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
        }

        .ads img {
            width: 30%;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>

<body>
    <!-- 顶部导航栏 -->
    <div class="top-navbar">
        <div class="left-links">
            <a href="#">帮助中心</a>
            <a href="#">关于我们</a>
        </div>
        <div class="right-links">
            <a href="#">登录</a>
            <a href="#">注册</a>
        </div>
    </div>
    <!-- 主导航栏 -->
    <div class="main-navbar">
        <div class="logo">
            <img src="8.jpg" alt="商城 logo">
        </div>
        <div class="search-box">
            <input type="text" placeholder="搜索商品">
            <button>搜索</button>
        </div>
        <div class="cart">
            <a href="zuoye5.1.html">
                <i class="fa fa-shopping-cart"></i> 购物车
            </a>
        </div>
    </div>
    <div class="header">
        <h1>欢迎来到我的电子产品商城</h1>
        <p>发现最新、最酷的电子产品！</p>
        <div class="carousel">
            <div class="carousel-inner">
                <div class="carousel-item">
                    <img src="7.jpg" alt="图片1">
                </div>
                <div class="carousel-item">
                    <img src="6.jpg" alt="图片2">
                </div>
                <div class="carousel-item">
                    <img src="1.gif" alt="图片3">
                </div>
            </div>
            <button class="carousel-control prev" onclick="prevSlide()">&#10094;</button>
            <button class="carousel-control next" onclick="nextSlide()">&#10095;</button>
            <div class="carousel-indicators">
                <span onclick="goToSlide(0)"></span>
                <span onclick="goToSlide(1)"></span>
                <span onclick="goToSlide(2)"></span>
            </div>
        </div>
    </div>
    <div class="ads">
        <img src="11.jpg" alt="广告1">
        <img src="13.jpg" alt="广告2">
        <img src="12.jpg" alt="广告3">
    </div>
    <div class="content">
        <h2>推荐商品</h2>
        <div class="product">
            <h3>智能手机</h3>
            <img src="4.jpg" alt="苹果手机" title="苹果手机">
            <a href="zuoye5.2.html">iPhone 13 Pro</a>
            <p>￥9999</p>
        </div>
        <div class="product" id="computer">
            <h3>电脑</h3>
            <a href="zuoye5.1.html"><img src="5.jpg" alt="高端电脑"
                    title="高端电脑"></a>
            <a href="zuoye5.2.html">5090整机</a>
            <p>￥19999</p>
        </div>
    </div>

    <div class="footer">
        <a href="http://www.baidu.com">百度</a>
        &copy;2025 我的商城 版权所有
    </div>

    <iframe src="http://172.18.90.221/chatbot/6zd7lZjRDmIOHusx" allow="microphone"></iframe>
    <a href="#" class="back-to-top">回到顶部</a>

    <script>
        let currentIndex = 0;
        const totalItems = document.querySelectorAll('.carousel-item').length;
        const carouselInner = document.querySelector('.carousel-inner');
        const indicators = document.querySelectorAll('.carousel-indicators span');

        function showSlide(index) {
            if (index < 0) {
                index = totalItems - 1;
            } else if (index >= totalItems) {
                index = 0;
            }
            const offset = -index * 100;
            carouselInner.style.transform = `translateX(${offset}%)`;
            currentIndex = index;

            indicators.forEach((indicator, i) => {
                if (i === index) {
                    indicator.classList.add('active');
                } else {
                    indicator.classList.remove('active');
                }
            });
        }

        function prevSlide() {
            showSlide(currentIndex - 1);
        }

        function nextSlide() {
            showSlide(currentIndex + 1);
        }

        function goToSlide(index) {
            showSlide(index);
        }


        setInterval(nextSlide, 3000);
    </script>
</body>

</html>         
